file rename, and spellfix
authorØyvind Kolås <ok@src.gnome.org>
Sun, 21 Aug 2005 18:14:26 +0000 (18:14 +0000)
committerØyvind Kolås <ok@src.gnome.org>
Sun, 21 Aug 2005 18:14:26 +0000 (18:14 +0000)
ChangeLog
babl/base/Makefile.am
babl/base/model-grayscale.c [deleted file]
docs/graphics/index.html

index e5b86d41bca25b16f604db9a35e3aece8ccf0e6a..cff1b944d378eaebf4a3470872fc44ecb997bac5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-08-21  Øyvind Kolås  <pippin@gimp.org>
+
+       * babl/base/model-grayscale.c: removed
+       * babl/base/model-gray.c: added
+       * babl/base/Makefile.am:
+       * docs/graphics/index.html: fixed spelling.
+
 2005-08-21  Øyvind Kolås  <pippin@gimp.org>
        
        * docs/LGPL: added (hopefully as a link to ../COPYING)
index 90147772772252d786ecadacf5b54e0c1c46874b..95d6e2b00c2b3897ed53945987aea62e91892003 100644 (file)
@@ -10,7 +10,7 @@ c_sources =                   \
        type-u8.c               \
        type-u16.c              \
        model-rgb.c             \
-       model-grayscale.c       \
+       model-grays.c           \
        model-lab.c             \
        model-ycbcr.c
 
diff --git a/babl/base/model-grayscale.c b/babl/base/model-grayscale.c
deleted file mode 100644 (file)
index 5c1dd35..0000000
+++ /dev/null
@@ -1,506 +0,0 @@
-/* babl - dynamically extendable universal pixel conversion library.
- * Copyright (C) 2005, Øyvind Kolås.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General
- * Public License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307, USA.
- */
-
-/* FIXME: this file should be renamed model-gray.c */
-
-#include "babl.h"
-#include "util.h"
-#include "rgb-constants.h"
-#include "math.h"
-
-static void components  (void);
-static void models      (void);
-static void conversions (void);
-
-void babl_base_model_gray (void)
-{
-  components  ();
-  models      ();
-  conversions ();
-}
-
-static void
-components (void)
-{
-  babl_component_new (
-   "Y", 
-   "id",    BABL_LUMINANCE,
-   "luma",
-   NULL);
-
-  babl_component_new (
-   "Y*A",
-   "id",    BABL_LUMINANCE_MUL_ALPHA,
-   "luma",
-   NULL);
-
-  babl_component_new (
-   "Y-g2.2", 
-   "id",    BABL_LUMINANCE_GAMMA_2_2,
-   "luma",
-   NULL);
-}
-
-static void
-models (void)
-{
-  babl_model_new (
-    "gray",
-    "id", BABL_GRAY,
-    babl_component_id (BABL_LUMINANCE),
-    NULL);
-
-  babl_model_new (
-    "gray-g2.2",
-    "id", BABL_GRAY_GAMMA_2_2,
-    babl_component_id (BABL_LUMINANCE_GAMMA_2_2),
-    NULL);
-
-  babl_model_new (
-    "graya-g2.2",
-    "id", BABL_GRAY_GAMMA_2_2_ALPHA,
-    babl_component_id (BABL_LUMINANCE_GAMMA_2_2),
-    babl_component_id (BABL_ALPHA),
-    NULL);
-
-  babl_model_new (
-    "graya",
-    "id", BABL_GRAY_ALPHA,
-    babl_component_id (BABL_LUMINANCE),
-    babl_component_id (BABL_ALPHA),
-    NULL);
-
-  babl_model_new (
-    "grayA",
-    "id", BABL_GRAY_ALPHA_PREMULTIPLIED,
-    babl_component_id (BABL_LUMINANCE_MUL_ALPHA),
-    babl_component_id (BABL_ALPHA),
-    NULL);
-
-}
-
-
-static void
-rgb_to_gray (int    src_bands,
-             void **src,
-             int   *src_pitch,
-             int    dst_bands,
-             void **dst,
-             int   *dst_pitch,
-             int    n)
-{
-  BABL_PLANAR_SANITY
-  while (n--)
-    {
-      double red, green, blue;
-      double luminance, alpha;
-
-      red   = *(double *)src[0];
-      green = *(double *)src[1];
-      blue  = *(double *)src[2];
-      if (src_bands>3)
-        alpha = *(double *)src[3];
-      else
-        alpha = 1.0;
-
-      luminance  = red   * RGB_LUMINANCE_RED +
-                   green * RGB_LUMINANCE_GREEN +
-                   blue  * RGB_LUMINANCE_BLUE;
-      *(double*)dst[0] = luminance;
-
-      if (dst_bands==2)
-        *(double*)dst[1] = alpha;
-
-      BABL_PLANAR_STEP
-    }
-}
-
-
-static void
-rgb_to_gray_2_2 (int    src_bands,
-                 void **src,
-                 int   *src_pitch,
-                 int    dst_bands,
-                 void **dst,
-                 int   *dst_pitch,
-                 int    n)
-{
-  BABL_PLANAR_SANITY
-  while (n--)
-    {
-      double red, green, blue;
-      double luminance, alpha;
-
-      red   = *(double *) src[0];
-      green = *(double *) src[1];
-      blue  = *(double *) src[2];
-      if (src_bands>3)
-        alpha = *(double *)src[3];
-      else
-        alpha = 1.0;
-
-      luminance  = red   * RGB_LUMINANCE_RED +
-                   green * RGB_LUMINANCE_GREEN +
-                   blue  * RGB_LUMINANCE_BLUE;
-      *(double*)dst[0] = linear_to_gamma_2_2 (luminance);
-
-      if (dst_bands==2)
-        *(double*)dst[1] = alpha;
-
-      BABL_PLANAR_STEP
-    }
-}
-
-
-static void
-gray_2_2_to_rgb (int    src_bands,
-                 void **src,
-                 int   *src_pitch,
-                 int    dst_bands,
-                 void **dst,
-                 int   *dst_pitch,
-                 int    n)
-{
-  BABL_PLANAR_SANITY
-  while (n--)
-    {
-      double luminance;
-      double red, green, blue;
-      double alpha;
-
-      luminance = gamma_2_2_to_linear (*(double *)src[0]);
-      red       = luminance;
-      green     = luminance;
-      blue      = luminance;
-      if (src_bands > 1)
-        alpha = *(double *)src[1];
-      else
-        alpha     = 1.0;
-
-      *(double*)dst[0] = red;
-      *(double*)dst[1] = green;
-      *(double*)dst[2] = blue;
-
-      if (dst_bands>3)
-        *(double*)dst[3] = alpha;
-
-      BABL_PLANAR_STEP
-    }
-}
-
-
-
-static void
-gray_to_rgb (int    src_bands,
-             void **src,
-             int   *src_pitch,
-             int    dst_bands,
-             void **dst,
-             int   *dst_pitch,
-             int    n)
-{
-  BABL_PLANAR_SANITY
-  while (n--)
-    {
-      double luminance;
-      double red, green, blue;
-      double alpha;
-
-      luminance = *(double *)src[0];
-      red       = luminance;
-      green     = luminance;
-      blue      = luminance;
-      if (src_bands > 1)
-        alpha = *(double *)src[1];
-      else
-        alpha     = 1.0;
-
-      *(double*)dst[0] = red;
-      *(double*)dst[1] = green;
-      *(double*)dst[2] = blue;
-
-      if (dst_bands>3)
-        *(double*)dst[3] = alpha;
-
-      BABL_PLANAR_STEP
-    }
-}
-
-static void
-gray_alpha_premultiplied_to_rgba (int    src_bands,
-                                  void **src,
-                                  int   *src_pitch,
-                                  int    dst_bands,
-                                  void **dst,
-                                  int   *dst_pitch,
-                                  int    n)
-{
-  BABL_PLANAR_SANITY
-  assert (src_bands == 2);
-  assert (dst_bands == 4);
-
-  while (n--)
-    {
-      double luminance = *(double *)src[0];
-      double alpha     = *(double *)src[1];
-
-      if (alpha > 0.001)
-        {
-          luminance = luminance / alpha;
-        }
-      else
-        {
-          luminance = 0.0;
-        }
-      
-      *(double*)dst[0] = luminance;
-      *(double*)dst[1] = luminance;
-      *(double*)dst[2] = luminance;
-      *(double*)dst[3] = alpha;
-      BABL_PLANAR_STEP
-    }
-}
-
-
-static void
-rgba_to_gray_alpha_premultiplied (int    src_bands,
-                                  void **src,
-                                  int   *src_pitch,
-                                  int    dst_bands,
-                                  void **dst,
-                                  int   *dst_pitch,
-                                  int    n)
-{
-  BABL_PLANAR_SANITY;
-  assert (src_bands == 4);
-  assert (dst_bands == 2);
-
-  while (n--)
-    {
-      double red       = *(double *)src[0];
-      double green     = *(double *)src[1];
-      double blue      = *(double *)src[2];
-      double alpha     = *(double *)src[3];
-      double luminance;
-
-      luminance  = red   * RGB_LUMINANCE_RED +
-                   green * RGB_LUMINANCE_GREEN +
-                   blue  * RGB_LUMINANCE_BLUE;
-
-      luminance *= alpha;
-      
-      *(double*)dst[0] = luminance;
-      *(double*)dst[2] = alpha;
-      BABL_PLANAR_STEP
-    }
-}
-
-static void
-non_premultiplied_to_premultiplied (int    src_bands,
-                                    void **src,
-                                    int   *src_pitch,
-                                    int    dst_bands,
-                                    void **dst,
-                                    int   *dst_pitch,
-                                    int    n)
-{
-  BABL_PLANAR_SANITY
-
-  while (n--)
-    {
-      double alpha;
-      int band;
-
-      alpha = *(double *)src[src_bands-1];
-      for (band=0; band<src_bands-1;band++)
-        {
-          *(double*)dst[band] = *(double*) src[band] * alpha;
-        }
-      *(double*)dst[dst_bands-1] = alpha;
-
-      BABL_PLANAR_STEP
-    }
-}
-
-static void
-premultiplied_to_non_premultiplied (int    src_bands,
-                                    void **src,
-                                    int   *src_pitch,
-                                    int    dst_bands,
-                                    void **dst,
-                                    int   *dst_pitch,
-                                    int    n)
-{
-  BABL_PLANAR_SANITY
-
-  while (n--)
-    {
-      double alpha;
-      int band;
-
-      alpha = *(double *)src[src_bands-1];
-      for (band=0; band<src_bands-1;band++)
-        {
-          if (alpha>0.001)
-            {
-              *(double*)dst[band] = *(double*) src[band] / alpha;
-            }
-          else
-            {
-              *(double*)dst[band] = 0.001;
-            }
-        }
-      *(double*)dst[dst_bands-1] = alpha;
-
-      BABL_PLANAR_STEP
-    }
-}
-
-static void
-conversions (void)
-{
-  babl_conversion_new (
-    "babl-base: gray-g2.2 to rgba",
-    "source",      babl_model_id (BABL_GRAY_GAMMA_2_2),
-    "destination", babl_model_id (BABL_RGBA),
-    "planar",      gray_2_2_to_rgb,
-    NULL
-  );
-
-
-  babl_conversion_new (
-    "babl-base: rgba to gray-g2.2",
-    "source",      babl_model_id (BABL_RGBA),
-    "destination", babl_model_id (BABL_GRAY_GAMMA_2_2),
-    "planar",      rgb_to_gray_2_2,
-    NULL
-  );
-
-  babl_conversion_new (
-    "babl-base: graya-g2.2 to rgba",
-    "source",      babl_model_id (BABL_GRAY_GAMMA_2_2_ALPHA),
-    "destination", babl_model_id (BABL_RGBA),
-    "planar",      gray_2_2_to_rgb,
-    NULL
-  );
-
-  babl_conversion_new (
-    "babl-base: rgba to graya-g2.2",
-    "source",      babl_model_id (BABL_RGBA),
-    "destination", babl_model_id (BABL_GRAY_GAMMA_2_2_ALPHA),
-    "planar",      rgb_to_gray_2_2,
-    NULL
-  );
-
-  babl_conversion_new (
-    "babl-base: gray to rgba",
-    "source",      babl_model_id (BABL_GRAY),
-    "destination", babl_model_id (BABL_RGBA),
-    "planar",      gray_to_rgb,
-    NULL
-  );
-
-  babl_conversion_new (
-    "babl-base: gray to rgb",
-    "source",      babl_model_id (BABL_GRAY),
-    "destination", babl_model_id (BABL_RGB),
-    "planar",      gray_to_rgb,
-    NULL
-  );
-
-  babl_conversion_new (
-    "babl-base: gray-alpha to rgba",
-    "source",      babl_model_id (BABL_GRAY_ALPHA),
-    "destination", babl_model_id (BABL_RGBA),
-    "planar",      gray_to_rgb,
-    NULL
-  );
-
-  babl_conversion_new (
-    "babl-base: gray-alpha to rgb",
-    "source",      babl_model_id (BABL_GRAY_ALPHA),
-    "destination", babl_model_id (BABL_RGB),
-    "planar",      gray_to_rgb,
-    NULL
-  );
-
-  babl_conversion_new (
-    "babl-base: rgba to gray-alpha",
-    "source",      babl_model_id (BABL_RGBA),
-    "destination", babl_model_id (BABL_GRAY_ALPHA),
-    "planar",      rgb_to_gray,
-    NULL
-  );
-
-  babl_conversion_new (
-    "babl-base: rgba to gray",
-    "source",      babl_model_id (BABL_RGBA),
-    "destination", babl_model_id (BABL_GRAY),
-    "planar",      rgb_to_gray,
-    NULL
-  );
-
-  babl_conversion_new (
-    "babl-base: rgb to gray-alpha",
-    "source",      babl_model_id (BABL_RGB),
-    "destination", babl_model_id (BABL_GRAY_ALPHA),
-    "planar",      rgb_to_gray,
-    NULL
-  );
-
-  babl_conversion_new (
-    "babl-base: rgb to gray",
-    "source",      babl_model_id (BABL_RGB),
-    "destination", babl_model_id (BABL_GRAY),
-    "planar",      rgb_to_gray,
-    NULL
-  );
-
-  babl_conversion_new (
-    "babl-base: gray-alpha to gray-alpha-premultiplied",
-    "source",      babl_model_id (BABL_GRAY_ALPHA),
-    "destination", babl_model_id (BABL_GRAY_ALPHA_PREMULTIPLIED),
-    "planar",      non_premultiplied_to_premultiplied,
-    NULL
-  );
-
-  babl_conversion_new (
-    "babl-base: gray-alpha-premultuplied to gray-alpha",
-    "source",      babl_model_id (BABL_GRAY_ALPHA_PREMULTIPLIED),
-    "destination", babl_model_id (BABL_GRAY_ALPHA),
-    "planar",      premultiplied_to_non_premultiplied,
-    NULL
-  );
-
-    babl_conversion_new (
-    "babl-base: gray-alpha-premultiplied to rgba",
-    "source",      babl_model_id (BABL_GRAY_ALPHA_PREMULTIPLIED),
-    "destination", babl_model_id (BABL_RGBA),
-    "planar",      gray_alpha_premultiplied_to_rgba,
-    NULL
-  );
-
-  babl_conversion_new (
-    "babl-base: rgba to gray-alpha-premultiplied",
-    "source",      babl_model_id (BABL_RGBA),
-    "destination", babl_model_id (BABL_GRAY_ALPHA_PREMULTIPLIED),
-    "planar",      rgba_to_gray_alpha_premultiplied,
-    NULL
-  );
-}
index 206470f52f1cb98d64b3a7355713d7ac3f598e8a..091449c1f8240f81093ef97dae7a070280a94d7a 100644 (file)
@@ -3,7 +3,7 @@
 
 <html>
   <head>
-    <title>babl graphisc</title>
+    <title>babl graphics</title>
 
     <link rel="icon" href="babl-16x16.png" type="image/png" />
     <link rel="shortcut icon" href="babl-16x16.png" type="image/png" />